External device properties for HMDΒΆ
The pluginkit can also acquire a set of specified device properties from the HMD device service. The accessed display configuration can be provided to the VR server for the VR app. HMD/Lens driver developer can store their own display configuration in VR DeviceService. Take the above DeviceService sample SimpleDevice as an example. The device properties can be accessed in the self-incremental asset folder in SDK/samples/SimpleDevice/app/src/main/assets/display. The name of the device properties can be determined by the model number set in the implementation of setupConfig() of the derived HmdDevice instance. The following is a snapshot of a part of a code from MyHmdDevice.java.
package htc.com.vr.sample.simpledevice;
import com.htc.vr.sdk.pluginkit.HmdDevice;
class MyHmdDevice extends HmdDevice {
@Override
public Config setupConfig() {
Config configure = new Config();
configure.trackingSystemName = "HMD Device";
configure.modelNumber = "MDNExmp";
return configure;
}
}
The device properties named with MDNExmp.properties can now be accessed under the assets path. The properties files that have device.properties in the file name are also accessible if the HMD device service doesn’t set the modelNumber.
Required display configuration in HMD device properties
The device properties that have [modelNumber].properties/device.properties in the file name depend on whether the model number is set to the plugin kit. The pluginkit will access the contents of the device properties through:
The display related configurations are listed below.
Required Device Properties | Description
|
---|---|
distortionvalue.distanceScaleX | The UV scale in dimension X, set as 1 by default.
|
distortionvalue.distanceScaleY | The UV scale in dimension Y, set as 1 by default.
|
distortionvalue.polynomialCoeffsRed | There are eight coefficients in the following formula
for lens distortion. The first of the coefficients is
the offset value usually being set as 0 in WVR platform.
The rest of the coefficients are corresponding
from K0 to K6.
|
distortionvalue.polynomialCoeffsGreen | There are eight coefficients in the following formula
for lens distortion. The first of the coefficients is
the offset value usually being set as 0 in WVR platform.
The rest of the coefficients are corresponding
from K0 to K6.
|
distortionvalue.polynomialCoeffsBlue | There are eight coefficients in the following formula
for lens distortion. The first of the coefficients is
the offset value usually being set as 0 in WVR platform.
The rest of the coefficients are corresponding
from K0 to K6.
|
lensvalue.distanceEyeToLens | Distance from eye to the lens, measured in millimeters.
|
lensvalue.distanceLensToScreen | Distance from lens to the screen, measured in
millimeters.
|
lensvalue.lensFocalLength | Focal length of the lens, measured in millimeters.
|
lensvalue.ipd | The distance, measured in meters, between both center of
eyes. Please refer to the following graph.
|
lensvalue.eyeCenterLeft | This is the proportion of the length of the lens where
the center of left eye locates in X and Y direction.
PluginKit currently assumes that the center of eye
locates in the middle of the lens.
Please keep this value set as 0.5, 0.5.
|
lensvalue.eyeCenterRight | This is the proportion of the length of the lens where
the center of right eye locates in X and Y direction.
PluginKit currently assumes that the center of eye
locates in the middle of the lens.
Please keep this value set as 0.5, 0.5.
|
misc.hasExternalScreen | This property is used to check whether
the external screen exists.
|
misc.gapBetweenPanels | The distance exists between the dual panels. This gap is
horizontally measured in millimeters across the
ineffective area from the rightmost pixel of the left
panel to the leftmost pixel of the right panel.
Please refer to the following graph.
|
externalscreen.width | The width of the external screen, measured in pixels.
Fill this property if misc.hasExternalScreen is true.
|
externalscreen.height | The height of the external screen, measured in pixels.
Fill this property if misc.hasExternalScreen is true.
|
externalscreen.physicalWidth | The physical width of the external screen, measured in
millimeters. Fill this property if misc.hasExternalScreen
is set as true.
|
externalscreen.physicalHeight | The physical height of the external screen, measured in
millimeters. Fill this property if misc.hasExternalScreen
is set as true.
|
externalscreen.refreshRate | Frame per second in the external display device.
|
externalscreen.vsyncTimeOffset | The time delay of vsync is relative to display source.
|
Three RGB color components should possess the corresponding lens distortion formula due to distinct wavelength.
The graph below illustrates how to determine the value of lensvalue.ipd and gap distance misc.gapBetweenPanels. In the case of the dual panels, the purple blocks represent the effective areas which are able to show the pixels on the panel. The gray blocks around the rims of the purple blocks represent the ineffective areas. The gap distance should be measured across from one side of the ineffective area to the other.